<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>补充信息</title>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>
<body class="iframeBody">
<form id="insTypInfo_form">
    <div class="fieldset1 tabel_col tabel_col_1 clearFix">
        <div class="fieldBox col_100">
            <div class="label">补充金额</div>
            <div class="field">
                <input name="supplementAmt" id="supplementAmt" type="text" class="ui-textbox" 
                	value="${prjPaySchSplmtVO.supplementAmts}"
                	 placeholder="填写格式为0.00    如:100.00" >
                <span class="requiredSymbol">*</span>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">补充时间</div>
            <div class="field">
                 <input name="supplementDt" id="supplementDt" type="text" isShow="iscar" class="ui-datepicker"
                        value="${prjPaySchSplmtVO.supplementDtZH }">
                 <span class="requiredSymbol" isShow="iscar">*</span>
            </div>
        </div>
        <div class="fieldBox col_100">
            <div class="label">备注</div>
            <div class="field">
                <textarea name="supplementRem" id="supplementRem" rows="4" class="ui-textarea l-textarea" style="width:80%" value="" validate="">${prjPaySchSplmtVO.supplementRem }</textarea>
            </div>
        </div>
        <div class="fieldBox col_100" id="fileDetail">
            <div class="label">附件</div>
            <div class="field">
                <jsp:include page="../../system/sysUlFilesRec/sysSysUlFilesRecUpload2.jsp" flush="true">
                     <jsp:param name="filePath" value="prjPaySchSplmt"/>
                </jsp:include>
                <input name="prjPaySchSplmtId" id="prjPaySchSplmtId" type="hidden" class="ui-textbox"
                                   value="${prjPaySchSplmtVO.id}">
            </div>
        </div>
        <c:if test = "${not empty prjPaySchSplmtVO.id}">
        <div class="fieldBox col_100" id="fileModify">
	        <div class="fiele">
	            <jsp:include page="../../system/sysUlFilesRec/sysUlFileRecList.jsp" flush="true">
	                <jsp:param name="pkId" value="${prjPaySchSplmtVO.id}"/>
	                <jsp:param name="tabNm" value="PRJ_PAY_SCH_SPLMT"/>
	            </jsp:include>
	        </div>
        </div>
        </c:if>
    </div>

    <div class="btnsBox">
        <span id="saveInsTypInfo_Btn" class="sq-button sq-button-round">保存</span>
    </div>
</form>
<script>
    $(function () {
        var insTypInfoId = "${prjPaySchSplmtVO.id}";//主键ID
        var prjPaySchFeeId = "${prjPaySchFeeId}";
        /* if($("#supplementRem")){
			$("#supplementRem").attr("readonly","readonly");
		} */
        
        $("#typClsCd").ligerComboBox({
            valueField: 'key',
            textField: 'value'
        });
        $("#typPid").ligerComboBox({
            valueField: 'key',
            textField: 'value'
        });
        $("#insTypInfo_form").ligerForm({
            validate: true
        });
        /*保存*/
        $("#saveInsTypInfo_Btn").click(function (event) {
            var form = liger.get("insTypInfo_form");
            if (!form.valid()) {
                $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_MUST_FIX_ITEM_INFO, SQ_type: "warning"});
                return false; //验证不通过，不执行以下代码
            }
            var data = form.getData();
            var fileParams = getUploadResultParams();//获取附件上传的信息
            data["fileParams"] = JSON.stringify(fileParams);
            $.ligerDialog.hide();
            var _url;
            if (insTypInfoId == '') {//新增
                _url = '<%=path%>/project/prjprdpayschm/rejectAdd.do?prjPaySchFeeId='+prjPaySchFeeId;
            } else {//修改
                _url = '<%=path%>/project/prjprdpayschm/rejectModify.do?id=' +insTypInfoId;
            }
            var wait_dialog;
            $.ajax({
                type: 'post',
                dataType: 'json',
                data: data,
                url: _url,
                beforeSend: function () {
                    wait_dialog = $.ligerDialog.SQalert({content: LogUtils.LOG_CMM_DATA_LOADING, SQ_type: "waitting"});
                },
                success: function (msg) {
                    wait_dialog.close();
                    if (msg.success == 1) {
                    	$("#prjPaySchSplmtId").val(msg.data);
                    	top.$.ligerDialog.SQalert({content: msg.info, SQ_type: "success"});
                    	 parent.$("#clearBtn").click();
                        parent.$("#searchBtn").click();
                        frameElement.dialog.close();
                    } else {
                        $.ligerDialog.SQalert({content: msg.info, SQ_type: "error"});
                    }
                }
            });
        });


    });
</script>
</body>
</html>
